Support Kafka topic auto creation config - #104
Merged
Merged
Conversation
zmstone
force-pushed
the
251028-support-kafka-topic-auto-creation
branch
from
October 29, 2025 21:05
4b0a15b to
b471385
Compare
hjianbo
approved these changes
Oct 30, 2025
thalesmg
approved these changes
Oct 30, 2025
| Req = kpro_req_lib:metadata(Vsn, [Topic], _IsAutoCreateAllowed = false), | ||
| -spec retry(fun(() -> {ok, term()} | {error, term()}), timeout()) -> {ok, term()} | {error, term()}. | ||
| retry(Fun, Timeout) -> | ||
| Deadline = erlang:monotonic_time(millisecond) + Timeout, |
Contributor
There was a problem hiding this comment.
If Timeout :: timeout(), then we must check if Timeout = infinity before adding.
| wolff_client:recv_leader_connection(Client, ?NO_GROUP, Topic, 0, self(), ?all_partitions), | ||
| receive | ||
| {leader_connection, Pid} when is_pid(Pid) -> | ||
| ?assert(is_pid(Pid)); |
Contributor
There was a problem hiding this comment.
Nit: already asserted by guard.
Comment on lines
+160
to
+164
| %% Helper function to create a mock connection for testing | ||
| mock_connection() -> | ||
| %% Create a mock connection that can be used in tests | ||
| %% This is a simplified mock - in real tests you might want to use a more sophisticated mock | ||
| {mock_connection, self()}. |
Comment on lines
+150
to
+158
| %% Helper function for meck mocking (similar to pattern used in other test files) | ||
| with_meck(Mod, FnName, MockedFn, Action) -> | ||
| ok = meck:new(Mod, [non_strict, no_history, no_link, passthrough]), | ||
| ok = meck:expect(Mod, FnName, MockedFn), | ||
| try | ||
| Action() | ||
| after | ||
| meck:unload(Mod) | ||
| end. |
thalesmg
approved these changes
Oct 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously
allow_auto_topic_creationfor metadata request is hard-coded tofalse.This PR makes it configurable.